Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

providers/mana: RC QPs #1461

Merged
merged 12 commits into from
Jul 7, 2024
Merged

Conversation

TaranovK
Copy link

This patch series aims to provide RC QP functionality to mana.

@TaranovK TaranovK force-pushed the for-next/cq_upstream branch 5 times, most recently from 354b2a1 to 4b0e953 Compare May 15, 2024 22:11
@rleon
Copy link
Member

rleon commented Jun 19, 2024

Please rebase your branch to latest rdma-core and prepare right "Update kernel headers" commit.

Thanks

@TaranovK
Copy link
Author

Please rebase your branch to latest rdma-core and prepare right "Update kernel headers" commit.

Thanks

Thanks. We are performing more extensive internal tests. So I will rebase with the commit ID, once I get a green flag from testers.

}

mana_ib_update_shared_mem_right_offset(qp, unmasked_queue_offset);
gdma_ring_send_doorbell(&qp->rc_qp.queues[USER_RC_SEND_QUEUE_REQUESTER]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to ring the doorbell once per wr within the loop body, or can the doorbell ring be moved outside the loop to batch multiple submissions?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is not necessary. The code is not final, and some final optimizations will be made last.
The initial reason for this implementation was debugging of HW/SW.

@rleon
Copy link
Member

rleon commented Jul 1, 2024

Please rebase your branch to latest rdma-core and prepare right "Update kernel headers" commit.
Thanks

Thanks. We are performing more extensive internal tests. So I will rebase with the commit ID, once I get a green flag from testers.

Any update?

@TaranovK TaranovK marked this pull request as draft July 1, 2024 14:16
@TaranovK
Copy link
Author

TaranovK commented Jul 1, 2024

@rleon It seems to take longer than I expected to get an internal signoff on the code. I marked the PR as draft. Sorry for noise.

@rleon
Copy link
Member

rleon commented Jul 1, 2024

@rleon It seems to take longer than I expected to get an internal signoff on the code. I marked the PR as draft. Sorry for noise.

So what will do with UAPI kernel part?
Our agreement is that kernel is merged when the rdma-core PR is published and ready and/or almost ready to be merged.

Konstantin Taranov added 7 commits July 1, 2024 20:12
Re-organize code to have cq.c and wr.c with CQ and WR code, respectively.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Mana HW expects buffers to be a power of 2 and be at least 4KB.
The existing align_hw_size returns 1 when input is 0, providing
incorrect buffer size for empty queues.
Change the order of align and pow to get 4096 for the input 0,
which is expected by the HW.

Use uint32_t in the get_wqe_size helper.

Fixes: 443f196 ("mana: Microsoft Azure Network Adapter (MANA) RDMA provider")
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement creation and destruction of RNIC cqs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement writing to doorbells for different queue types.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Define struct for fields related to raw QPs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement shadow queues to store pending WQEs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Introduce helpers to work with PSNs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
@TaranovK
Copy link
Author

TaranovK commented Jul 1, 2024

@rleon It seems to take longer than I expected to get an internal signoff on the code. I marked the PR as draft. Sorry for noise.

So what will do with UAPI kernel part? Our agreement is that kernel is merged when the rdma-core PR is published and ready and/or almost ready to be merged.

Then in this case, I update the branch to have the code that was agreed with my colleagues. It will be ready tomorrow.

Sorry again.

@TaranovK TaranovK force-pushed the for-next/cq_upstream branch 4 times, most recently from c4589a6 to 6ceae2a Compare July 2, 2024 15:09
@TaranovK TaranovK marked this pull request as ready for review July 2, 2024 16:17
@TaranovK
Copy link
Author

TaranovK commented Jul 2, 2024

@rleon Sorry again for the delay. The code is ready.

free(context->qp_table[i].table);
}
pthread_mutex_unlock(&context->qp_table_mutex);
pthread_mutex_destroy(&context->qp_table_mutex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line says to me that previous lock/unlock is useless.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess you are implying that it is user's problem if it called "close device" while other threads access context.

I will remove it in a bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying something different. If you have lock destroy, it means that this lock is not used in this path otherwise your concurrent thread which used this lock will crash.

Konstantin Taranov added 2 commits July 5, 2024 10:48
Implement a table for finding QPs using receive queue ids.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement creation and destruction of RC QPs.
Add helpers to work with rollback memory regions.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Konstantin Taranov added 3 commits July 5, 2024 10:48
Implement modify QP for RC QPs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement work posting and define HW structures.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Implement polling of CQs and arming CQs.
Add processing of CQEs for RC QPs.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
@rleon rleon merged commit 8e995cd into linux-rdma:master Jul 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants